package cn.shyouchi.wuguanjia.android.ui.patrol.report;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Eenie on 2016/12/28 at 13:22
 * Email: 472279981@qq.com
 * Des:
 */

public class PatrolErrorEntity {


    /**
     * resultCode : 0
     * resultMessage : [{"id":27,"uniqueid":"YC201701101043169024","title":"异常标题","content":"异常内容","time":"2017-01-10 10:43:16","inspectionpoint":{"id":74,"inspectionpoint":75,"inspectionname":"测","inspectionmethod":2,"inspectiontime":"14:39:00","inspectioncontent":"测试"},"user":{"id":1,"name":"唐海斌"},"image":[{"image":"/images/inspection/20170110/20170110104316YC172919223.jpg"}]}]
     */

    private int resultCode;
    private List<ResultMessageBean> resultMessage;

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public List<ResultMessageBean> getResultMessage() {
        return resultMessage;
    }

    public void setResultMessage(List<ResultMessageBean> resultMessage) {
        this.resultMessage = resultMessage;
    }

    public static class ResultMessageBean implements Parcelable {
        /**
         * id : 27
         * uniqueid : YC201701101043169024
         * title : 异常标题
         * content : 异常内容
         * time : 2017-01-10 10:43:16
         * inspectionpoint : {"id":74,"inspectionpoint":75,"inspectionname":"测","inspectionmethod":2,"inspectiontime":"14:39:00","inspectioncontent":"测试"}
         * user : {"id":1,"name":"唐海斌"}
         * image : [{"image":"/images/inspection/20170110/20170110104316YC172919223.jpg"}]
         */

        private int id;
        private String uniqueid;
        private String title;
        private String content;
        private String time;
        private InspectionpointBean inspectionpoint;
        private UserBean user;
        private List<ImageBean> image;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getUniqueid() {
            return uniqueid;
        }

        public void setUniqueid(String uniqueid) {
            this.uniqueid = uniqueid;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public InspectionpointBean getInspectionpoint() {
            return inspectionpoint;
        }

        public void setInspectionpoint(InspectionpointBean inspectionpoint) {
            this.inspectionpoint = inspectionpoint;
        }

        public UserBean getUser() {
            return user;
        }

        public void setUser(UserBean user) {
            this.user = user;
        }

        public List<ImageBean> getImage() {
            return image;
        }

        public void setImage(List<ImageBean> image) {
            this.image = image;
        }

        public static class InspectionpointBean implements Parcelable {
            /**
             * id : 74
             * inspectionpoint : 75
             * inspectionname : 测
             * inspectionmethod : 2
             * inspectiontime : 14:39:00
             * inspectioncontent : 测试
             */

            private int id;
            private int inspectionpoint;
            private String inspectionname;
            private int inspectionmethod;
            private String inspectiontime;
            private String inspectioncontent;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public int getInspectionpoint() {
                return inspectionpoint;
            }

            public void setInspectionpoint(int inspectionpoint) {
                this.inspectionpoint = inspectionpoint;
            }

            public String getInspectionname() {
                return inspectionname;
            }

            public void setInspectionname(String inspectionname) {
                this.inspectionname = inspectionname;
            }

            public int getInspectionmethod() {
                return inspectionmethod;
            }

            public void setInspectionmethod(int inspectionmethod) {
                this.inspectionmethod = inspectionmethod;
            }

            public String getInspectiontime() {
                return inspectiontime;
            }

            public void setInspectiontime(String inspectiontime) {
                this.inspectiontime = inspectiontime;
            }

            public String getInspectioncontent() {
                return inspectioncontent;
            }

            public void setInspectioncontent(String inspectioncontent) {
                this.inspectioncontent = inspectioncontent;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.id);
                dest.writeInt(this.inspectionpoint);
                dest.writeString(this.inspectionname);
                dest.writeInt(this.inspectionmethod);
                dest.writeString(this.inspectiontime);
                dest.writeString(this.inspectioncontent);
            }

            public InspectionpointBean() {
            }

            protected InspectionpointBean(Parcel in) {
                this.id = in.readInt();
                this.inspectionpoint = in.readInt();
                this.inspectionname = in.readString();
                this.inspectionmethod = in.readInt();
                this.inspectiontime = in.readString();
                this.inspectioncontent = in.readString();
            }

            public static final Creator<InspectionpointBean> CREATOR = new Creator<InspectionpointBean>() {
                @Override
                public InspectionpointBean createFromParcel(Parcel source) {
                    return new InspectionpointBean(source);
                }

                @Override
                public InspectionpointBean[] newArray(int size) {
                    return new InspectionpointBean[size];
                }
            };
        }

        public static class UserBean implements Parcelable {
            /**
             * id : 1
             * name : 唐海斌
             */

            private int id;
            private String name;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.id);
                dest.writeString(this.name);
            }

            public UserBean() {
            }

            protected UserBean(Parcel in) {
                this.id = in.readInt();
                this.name = in.readString();
            }

            public static final Creator<UserBean> CREATOR = new Creator<UserBean>() {
                @Override
                public UserBean createFromParcel(Parcel source) {
                    return new UserBean(source);
                }

                @Override
                public UserBean[] newArray(int size) {
                    return new UserBean[size];
                }
            };
        }

        public static class ImageBean implements Parcelable {
            /**
             * image : /images/inspection/20170110/20170110104316YC172919223.jpg
             */

            private String image;

            public String getImage() {
                return image;
            }

            public void setImage(String image) {
                this.image = image;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.image);
            }

            public ImageBean() {
            }

            protected ImageBean(Parcel in) {
                this.image = in.readString();
            }

            public static final Creator<ImageBean> CREATOR = new Creator<ImageBean>() {
                @Override
                public ImageBean createFromParcel(Parcel source) {
                    return new ImageBean(source);
                }

                @Override
                public ImageBean[] newArray(int size) {
                    return new ImageBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.id);
            dest.writeString(this.uniqueid);
            dest.writeString(this.title);
            dest.writeString(this.content);
            dest.writeString(this.time);
            dest.writeParcelable(this.inspectionpoint, flags);
            dest.writeParcelable(this.user, flags);
            dest.writeList(this.image);
        }

        public ResultMessageBean() {
        }

        protected ResultMessageBean(Parcel in) {
            this.id = in.readInt();
            this.uniqueid = in.readString();
            this.title = in.readString();
            this.content = in.readString();
            this.time = in.readString();
            this.inspectionpoint = in.readParcelable(InspectionpointBean.class.getClassLoader());
            this.user = in.readParcelable(UserBean.class.getClassLoader());
            this.image = new ArrayList<ImageBean>();
            in.readList(this.image, ImageBean.class.getClassLoader());
        }

        public static final Parcelable.Creator<ResultMessageBean> CREATOR = new Parcelable.Creator<ResultMessageBean>() {
            @Override
            public ResultMessageBean createFromParcel(Parcel source) {
                return new ResultMessageBean(source);
            }

            @Override
            public ResultMessageBean[] newArray(int size) {
                return new ResultMessageBean[size];
            }
        };
    }
}
